package normalclass;
/*
* 子类继承父类的属性也会存储在子类空间中
*引用类型做参数传递本质上是传递的对象的地址值
* */
public class Worker extends Person{
    public static void main(String[] args) {
        Worker worker = new Worker();
        worker.name = "老王";
        method01(worker);

        method02(new Worker());

    }

    public static void method01(Worker w){
        System.out.println(w.name);
    }

    public static void method02(Person p){
        System.out.println(p.name);
    }
}
